﻿using System;
using System.Collections.Generic;
using System.Linq;
using System.Text;
using System.Threading.Tasks;

namespace helloworld2.MODEL
{
    class Edge
    {
        public int id { get; set; }
        public double length { get; set; }
        public List<Vertex> connections = new List<Vertex>();
        public Edge previousNode { get; set; }
        public bool visited { get; set; }
        EdgeContainer ec = EdgeContainer.Instance;
        public bool isStation = false;

        public Edge(int id, double length)
        {
            this.id = id;
            this.length = length;
            this.visited = false;
            ec.addEdge(this);
        }
        //Opret edge med bonus station attribut
        public Edge(int id, double length, bool isStation)
        {
            this.id = id;
            this.length = length;
            this.visited = false;
            ec.addEdge(this);
            this.isStation = isStation;
        }

        public Edge()
        {

        }

        public void addConnection(Vertex v)
        {
            
            this.connections.Add(v);
            Console.WriteLine("this connection id: " + this.id + "connection count " + this.connections.Count);
        }

        public List<Vertex> getConnection()
        {
            List<Vertex> returnList = new List<Vertex>();
            foreach (Vertex v in connections)
            {
                returnList.Add(v);
            }
            return returnList;
        }

      
    }
}
